package com.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mapper.StopcarmoneyMapper;
import com.pojo.Stopcarmoney;
import com.service.StopcarmoneyService;
import com.vo.LineVo;
import com.vo.StopcarmoneyPageVo;
import com.vo.StopcarmoneyVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StopcarmoneyServiceimpl implements StopcarmoneyService {
    @Resource
    private StopcarmoneyMapper stopcarmoneyMapper;
    @Override
    public int insertSelective(Stopcarmoney record) {
        int i = stopcarmoneyMapper.insertSelective(record);
        return i;
    }

    @Override
    public PageInfo<Stopcarmoney> selectall(StopcarmoneyPageVo stopcarmoneyPageVo) {
        PageHelper.startPage(stopcarmoneyPageVo.getPage(),stopcarmoneyPageVo.getLimit());
        List<Stopcarmoney> selectall = stopcarmoneyMapper.selectall(stopcarmoneyPageVo);
        PageInfo<Stopcarmoney> pageInfo=new PageInfo<>(selectall);

        return pageInfo;
    }

    @Override
    public int deleteByid(Integer id) {
        int i = stopcarmoneyMapper.deleteByPrimaryKey(id);
        return i;
    }
    @Override
    public int addStopCarMoney(StopcarmoneyVo stopcarmoneyVo) {
        int i = stopcarmoneyMapper.addCarMoney(stopcarmoneyVo);
        return i;
    }

    @Override
    public List<Stopcarmoney> OwnerSelectStopCarByOwnerphone(String ownerphone) {
        List<Stopcarmoney> stopcarmonies = stopcarmoneyMapper.OwnerSelectStopCarByOwnerphone(ownerphone);
        return stopcarmonies;
    }

    @Override
    public int updateIsNoById(Integer id) {
        int i = stopcarmoneyMapper.updateIsNoById(id);
        return i;
    }

    @Override
    public Stopcarmoney OwnerSelectStopCarBy(String parklotname, String parkname) {
        Stopcarmoney stopcarmoney = stopcarmoneyMapper.OwnerSelectStopCarBy(parklotname, parkname);
        return stopcarmoney;
    }

    @Override
    public List<LineVo> selectline() {
        List<LineVo> selectline = stopcarmoneyMapper.selectline();
        return selectline;
    }

    @Override
    public PageInfo<Stopcarmoney> OwnerSelectStopCar(StopcarmoneyVo stopcarmoneyVo) {
        PageHelper.startPage(stopcarmoneyVo.getPage(),stopcarmoneyVo.getLimit());
        List<Stopcarmoney> stopcarmonies = stopcarmoneyMapper.OwnerSelectStopCar(stopcarmoneyVo);
        PageInfo<Stopcarmoney> pageInfo=new PageInfo<>(stopcarmonies);
        return pageInfo;
    }
}
